package messagesvc.api.impl;

import cn.ucloud.microsf.commonlib.response.EmptyResponse;
import cn.ucloud.microsf.commonlib.response.PageListResponse;
import cn.ucloud.microsf.messagesvc.executor.record.MessageSendExecutor;
import cn.ucloud.microsf.messagesvc.executor.record.RecordListExecutor;
import cn.ucloud.microsf.messagesvc.request.record.RecordListRequest;
import cn.ucloud.microsf.messagesvc.request.record.SendRequest;
import cn.ucloud.microsf.messagesvc.response.record.RecordListResponse;
import messagesvc.api.MessageController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MessageControllerImpl implements MessageController {

  @Autowired
  private MessageSendExecutor messageSendExecutor;
  @Autowired
  private RecordListExecutor recordListExecutor;

  @Override
  public EmptyResponse send(SendRequest request) {
    return messageSendExecutor.execute(request);
  }

  @Override
  public PageListResponse<RecordListResponse> list(RecordListRequest request) {
    return recordListExecutor.execute(request);
  }
}
